from selenium import webdriver
import time

# 创建options对象
options = webdriver.ChromeOptions()
options.add_experimental_option('mobileEmulation', {'deviceName': 'iPhone SE'})
driver = webdriver.Chrome(options=options)



time.sleep(2)
driver.get('https://www.baidu.com')
time.sleep(2)
driver.find_element_by_id('index-kw').send_keys('天气预报')
time.sleep(2)
driver.find_element_by_id('index-bn').click()
time.sleep(2)
driver.quit()